Skip to content

[docs repo] fix can't edit a file, delete a file #10679

Closed
kongtiaowang wants to merge 54 commits into
aces:29.0-releasefrom
kongtiaowang:2026-06-22-fix-doc-edit
Closed

[docs repo] fix can't edit a file, delete a file #10679
kongtiaowang wants to merge 54 commits into
aces:29.0-releasefrom
kongtiaowang:2026-06-22-fix-doc-edit

Conversation

@kongtiaowang

@kongtiaowang kongtiaowang commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

document repo can't edit a file.
#10593
document repo can't detele a file.
#10592
after run
"target=document_repository npm run compile" to test

@kongtiaowang kongtiaowang added the 29.0.0 - Bugs Issues found during the release testing for 29.0.0 label Jun 22, 2026
@github-actions github-actions Bot added Language: PHP PR or issue that update PHP code Module: document_repository PR or issue related to documen_repository module labels Jun 22, 2026
@CamilleBeau CamilleBeau added the Critical to release PR or issue is key for the release to which it has been assigned label Jun 25, 2026
lapadulamichael

This comment was marked as outdated.

@lapadulamichael lapadulamichael added the Passed manual tests PR has been successfully tested by at least one peer label Jun 29, 2026
@lapadulamichael lapadulamichael removed the Passed manual tests PR has been successfully tested by at least one peer label Jun 29, 2026
@github-actions github-actions Bot added the Language: Javascript PR or issue that update Javascript code label Jun 29, 2026
@kongtiaowang kongtiaowang changed the title [docs repo] fix perm check [docs repo] fix can't edit a file, delete a file Jun 29, 2026

@lapadulamichael lapadulamichael left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lapadulamichael lapadulamichael added the Passed manual tests PR has been successfully tested by at least one peer label Jun 30, 2026
Comment thread modules/document_repository/php/files.class.inc
@kongtiaowang kongtiaowang requested a review from driusan June 30, 2026 17:27
@driusan

driusan commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

@kongtiaowang I don't understand why the "Files" became "Videos" in this PR. Doesn't the document repository mostly consist of non-video files?

Some of the references to "video" in the diff seem to already exist, but wouldn't it make more sense to change those to "File" instead of changing the "File" references to "Video"?

priyavrat7 and others added 4 commits July 2, 2026 10:22
**Situation:**
In the LORIS `user_accounts` module (`edit_user` interface), clicking
the "Reject User" button triggers an immediate AJAX call to reject the
account. There is no confirmation dialog, making it extremely easy for
an administrator to accidentally reject a user with a misclick.

**Task:**
My objective was to introduce a confirmation step before executing the
rejection AJAX call, ensuring a better and safer user experience. The
implementation needed to adhere strictly to modern LORIS framework
standards, specifically utilizing the SweetAlert2 library.

**Action:**
- **Refactored Legacy Code:** Converted the plain jQuery script
`modules/user_accounts/js/rejectUser.js` into a modern proper source
file at `modules/user_accounts/jsx/rejectUser.js`.
- **Integrated SweetAlert2:** Used modern Webpack imports (`import swal
from 'sweetalert2';`) to implement a `swal.fire()` confirmation modal
with a 'warning' type, standardizing the UI with other LORIS modules.
- **Updated Webpack Entry Point:** Registered the new `rejectUser` file
in `webpack.config.ts` under the `user_accounts` entry.
- **Compiled Bundle:** Built the new asset via `npm run compile`,
resulting in a self-contained Webpack JS bundle that replaces the old
jQuery file.

**Result:**
Administrators can now see SweetAlert2 warning dialog when attempting to
reject a user. The AJAX call is correctly blocked until the user
explicitly clicks "Yes, reject user!", completely preventing accidental
rejections and fixes aces#10474.

<img width="1706" height="972" alt="image"
src="https://github.com/user-attachments/assets/686cbb68-072d-4d50-80d7-f7e91a9e7e51"
/>
…s#10685)

## Brief summary of changes
The dataquery TestPlan specifies that queries should only be able to be
pinned by users with "Data Query Tool: Admin dataquery queries"
permission.
- [x] Have you updated related documentation?

#### Testing instructions (if applicable)

1. Verify the TestPlan

#### Link(s) to related issue(s)

* Resolves [10602](aces#10602).

Co-authored-by: Michael Lapadula <michael.lapadula@mcin.ca>
## Brief summary of changes
No notifications were being sent out because the "Active_to" condition
in the query for users to be notified had the opposite logic than it
should (it was checking users who have already had their access expired
instead of users who are still active).

- [ ] Have you updated related documentation?

#### Testing instructions (if applicable)

1. Create a user and grant the user each permission from the
my_preferences page. Make sure the user is active and does not have an
active_to date set
2. Test each operation that sends notifications to make sure the
notifications are properly sent
3. Edit the user to have an active_to date set before now
4. Make sure the notifications are not sent
5. Edit the user to have an active_to date set after now
6. Make sure the notifications are sent
7. Remove all of the notification settings from my_preferences page
8. Make sure that the notifications are not  sent

#### Link(s) to related issue(s)

* Resolves aces#10588
Related to aces#10563

Fix 'Array' in the subject line. 

To test:
Try resetting the password from the login page and check the
notification email subject is `Lost Password - [study name]`.

---------

Co-authored-by: root <root@cbrain.mcgill.ca>
@github-actions github-actions Bot added Module: statistics PR or issue related to statistics module Module: api PR or issue related to api module Module: behavioural_qc PR or issue related behavioural_qc module Module: candidate_parameters PR or issue related to candidate_parameters module Module: candidate_profile PR or issue related to candidate_profile module Module: configuration PR or issue related to configuration module Module: dictionary PR or issue related to (new) dictionary module Module: electrophysiology_browser PR or issue related to electrophysiology_browser module Module: imaging_browser PR or issue related to imaging_browser module Module: imaging_uploader PR or issue related to imaging_uploader module Module: instrument_list PR or issue related to instrument_list module Module: instrument_manager PR or issue related to instrument_manager module Module: instruments PR or issue related to instruments module Module: login PR or issue related to login module Module: media PR or issue related to media module Module: module_manager PR or issue related to module_manager module Module: oidc PR or issue related to the oidc (OpenID Connect) module Module: publication PR or issue related to the publication module Module: survey_accounts PR or issue related to the survey_accounts module Module: timepoint_list PR or issue related to the timepoint_list module Module: user_accounts PR or issue related to the user_accounts module Module: data_release PR or issue related to data_release module Module: dataquery PR or issue related to (new) dataquery module Multilingual Any tasks related to making LORIS multilingual Module: redcap PR or issue related to redcap module labels Jul 2, 2026
@driusan

driusan commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

@kongtiaowang It looks like this needs to be rebased? There's a bunch of unrelated changes in the diff now.

@kongtiaowang

Copy link
Copy Markdown
Contributor Author

@driusan This PR in not clean. I made a new #10735 to replace this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

29.0.0 - Bugs Issues found during the release testing for 29.0.0 Critical to release PR or issue is key for the release to which it has been assigned Language: Javascript PR or issue that update Javascript code Language: PHP PR or issue that update PHP code Language: SQL PR or issue that update SQL code Module: api PR or issue related to api module Module: behavioural_qc PR or issue related behavioural_qc module Module: candidate_parameters PR or issue related to candidate_parameters module Module: candidate_profile PR or issue related to candidate_profile module Module: configuration PR or issue related to configuration module Module: data_release PR or issue related to data_release module Module: dataquery PR or issue related to (new) dataquery module Module: dictionary PR or issue related to (new) dictionary module Module: document_repository PR or issue related to documen_repository module Module: electrophysiology_browser PR or issue related to electrophysiology_browser module Module: imaging_browser PR or issue related to imaging_browser module Module: imaging_uploader PR or issue related to imaging_uploader module Module: instrument_list PR or issue related to instrument_list module Module: instrument_manager PR or issue related to instrument_manager module Module: instruments PR or issue related to instruments module Module: login PR or issue related to login module Module: media PR or issue related to media module Module: module_manager PR or issue related to module_manager module Module: oidc PR or issue related to the oidc (OpenID Connect) module Module: publication PR or issue related to the publication module Module: redcap PR or issue related to redcap module Module: statistics PR or issue related to statistics module Module: survey_accounts PR or issue related to the survey_accounts module Module: timepoint_list PR or issue related to the timepoint_list module Module: user_accounts PR or issue related to the user_accounts module Multilingual Any tasks related to making LORIS multilingual Passed manual tests PR has been successfully tested by at least one peer RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset

Projects

None yet

Development

Successfully merging this pull request may close these issues.